<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<!DOCTYPE HTML>
<html>
<head>
<!-- 引入公共部分meta.jsp -->
<jsp:include page="meta.jsp"></jsp:include>

<title>审核申请 - H-ui.admin v3.0</title>

</head>
<body>
	<article class="cl pd-20">
		<form class="form form-horizontal">
			<input type="hidden" name="appId" id="appId" value="${userApply.appid}">
			<!-- 用户名 -->
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span
					class="c-red">*</span>申请用户名称：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text"
						value="${userApply.uName}" readonly="readonly" id="uName"
						name="uName">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>申请理由：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" placeholder=""
						   value="${userApply.appreason}" readonly="readonly" id="appReason"
						   name="appReason">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>申请时间：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" placeholder=""
						   value="${userApply.appcurrenttime}" readonly="readonly" id="appCurrentTime"
						   name="appCurrentTime">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>申请资质：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<img src="${pageContext.request.contextPath}/${userApply.appimgeurl}" width="100px" height="50px">
				</div>
			</div>

			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>是否通过：</label>
				<div class="formControls col-xs-8 col-sm-9 skin-minimal">
					<div class="radio-box">
						<input type="radio" id="appStatus-1" name="appStatus" value="1" checked>
						<label for="appStatus-1">通过</label>
					</div>
					<div class="radio-box">
						<input type="radio" id="appStatus-2" name="appStatus" value="2"> <label
							for="appStatus-2">不通过</label>
					</div>
				</div>
			</div>

			<!-- 审核意见 -->
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-3">审核意见：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<textarea name="appAduitOpinion" id="appAduitOpinion" cols="" rows=""
						class="textarea" placeholder="请输入审核意见...">${userApply.appaduitopinion}</textarea>
					<p class="textarea-numberbar">
						<em class="textarea-length">0</em>/50
					</p>
				</div>
			</div>

			<!-- 提交 -->
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
					<input class="btn btn-primary radius" type="button"
						value="&nbsp;&nbsp;提交&nbsp;&nbsp;" id="uBtn">
				</div>
			</div>
		</form>
	</article>

	<!-- 导入公共部分footer.jsp 这是jquery.min.js、layer.js、H-ui.js、H-ui.admin.page.js -->
	<jsp:include page="footer.jsp"></jsp:include>

	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/admin/lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript">
		$(function() {
			$("#uBtn").click(function(){
				/*$.get("${pageContext.request.contextPath}/adminUser/auditApply",
						{
							"uName" : $("#uName").val(),
					     "uSex" : $("input[type='radio']:checked").val(),
					     "uPhone" : $("#uPhone").val(),
						 "uBirthday" : $("#uBirthday").val(),
						 "uAddress" : $("#uAddress").val(),
					 	 "uStatus" : $("#uStatus").val()},
						function(data, status,
							xhr) {
								
					 		if (data == "修改成功") {
								layer.msg(data, {
									icon : 1,
									time : 1000

								}, function() {
									location.href="${pageContext.request.contextPath}/users.action";
								});
							}
				});*/
				$.ajax({
					type : "post",
					url : "${pageContext.request.contextPath}/adminUser/auditApply",
					data : {
						appId : $("#appId").val(),
						appStatus : $("input[type='radio']:checked").val(),
						appAduitOpinion:$("#appAduitOpinion").val(),
						appAuditUser :"${admin.adminname}",
					},
					success : function(data) {
						if (data.code == 0) {
							layer.msg(data.msg, {
								icon : 1,
								time : 1000
							}, function() {
								parent.location.reload();
								layer_close();

							});
						}else if(data.code == 1){
							layer.msg(data.msg, {
								icon : 2,
								time : 1000
							}, function() {
								layer_close();
								location.reload();
							});
						}
					}
				});
			}); 
			
		
		});
	</script>
	<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>